﻿<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@ include file="/WEB-INF/layouts/include.inc.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="${ctx }/styles/v2/css/gg.css" />
<script type="text/javascript" language="javascript" src="${ctx }/styles/v2/js/listButton.js"></script>
<!-- border: 2px solid #FFFFFF; -->
<script type="text/javascript">
$(function(){
	
	var time = eval("${time}");
	if(time==1){
		$("#time_1").css("border","2px solid #FFFFFF");
	}else if(time==2){
		$("#time_2").css("border","2px solid #FFFFFF");
	}else if(time==3){
		$("#time_3").css("border","2px solid #FFFFFF");
	}else if(time==4){
		$("#time_4").css("border","2px solid #FFFFFF");
	}else if(time==0){
		$("#time_0").css("border","2px solid #FFFFFF");
	}
	
	$("#time_1").click(function(){
		$("#time").val(1);
		$("#form1").submit();
	});
	
	$("#time_2").click(function(){
		$("#time").val(2);
		$("#form1").submit();
	});
	
	$("#time_3").click(function(){
		$("#time").val(3);
		$("#form1").submit();
	});
	
	$("#time_4").click(function(){
		$("#time").val(4);
		$("#form1").submit();
	});
	
	$("#time_0").click(function(){
		$("#time").val(0);
		$("#form1").submit();
	});
	
	
});

function getSuperviseList(id){
	$.post("${ctx}/v2/publicSupervise/findByDocId",{"docId":id},function(data){
		
		$("#superviseName").html("监管记录（单位名称："+data.companyName+"）");
		
		$("#superviseList").html("");
		$(data.superviseList).each(function(i,item){
			var str = '<tr class="tr_1">'+
				'<td>'+(i+1)+'</td>'+
				'<td>'+item.type+'</td>'+
				'<td>'+item.guideDate+'</td>'+
				'<td style="width: 300px">'+item.context+'</td>'+
				'<td>'+item.userName+'</td>'+
				'<td><a href="'+item.id+'" id="showbtn" name="showbtn" value="点我弹出层" onclick="showid(\'smallLay\');">详细</a></td>'+
			'</tr>';
			
			$("#superviseList").append(str);
		});
	});
}
	
</script>

</head>

<body>
	<div class="op">
		<div class="cz">
			<p style="font-size: 19px;">操作栏</p>
		</div>

		<%@ include file="/WEB-INF/views/v2/publicDoc/left.jsp"%>
	<div  style="padding-top:110px;">
		<tags:tree url="${ctx }/v2/publicDoc/offlist" formId="form1"></tags:tree>
	</div></div>


	<div class="con">
		<!--导航begin-->
		<%@ include file="/WEB-INF/layouts/nav.jsp"%>
		<!--导航end-->

		<!--全部管理对象-->
		<div class="object">
			<h3>公共场所回收站列表  (当前位置:${currentAddress.name })</h3>
			<div style="margin-left: 10px; margin-top: 10px;">
				<input id="newBtn" type="button" value="新增" alt="" onclick="location.href='${ctx }/v2/publicDoc/edit'" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> 
				<input id="startBtn" type="button" value="恢复营业" href="${ctx }/v2/publicDoc/start" disabled="false" alt="" style="width: 70px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="offBtn" type="button" value="注销" href="${ctx }/v2/publicDoc/off" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="stopBtn" type="button" value="停业" href="${ctx }/v2/publicDoc/stop" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" /> 
				<input id="deleteBtn" type="button" value="删除" href="${ctx }/v2/publicDoc/delete" alt="" disabled="false" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #aaa; color: white; font-size: 13px;" />
			</div>

			<form id="form1" name="form1" action="${ctx }/v2/publicDoc/offlist" method="post">
				<input type="hidden" id="time" name="time" value="${time }"/>
				<input type="hidden" id="internalCode" name="internalCode" value="${obj.internalCode }"/>
				<div style="margin-left: 10px; margin-top: 10px; color: #6d8ea6">
					单位名称：<input name="companyName" type="text" value="${obj.companyName }" class="btname" /> 
					单位地址：<input name="address" type="text" value="${obj.address }" class="btname" /> 
					负责人：<input name="legal" type="text" value="${obj.legal }" class="btname" /> <input type="submit" value="搜索" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px; margin-left: 5px;" />
					<div style="float: right; margin-right: 10px; color: #6d8ea6;">
						是否有证： <select id="sel2" onChange="chg()" style="border: 1px solid #ddd; border-radius: 5px; height: 25px; color: #6d8ea6; width: 60px; margin-right: 10px;">
							<option value="">全部</option>
							<option value="是" <c:if test="${obj.state eq '是' }">selected</c:if>>有证</option>
							<option value="否" <c:if test="${obj.state eq '否' }">selected</c:if>>无证</option>
						</select> 状态类型： <select name="state" style="border: 1px solid #ddd; border-radius: 5px; height: 25px; color: #6d8ea6; width: 60px;">
							<option value="">全部</option>
							<option value="营业" <c:if test="${obj.state eq '营业' }">selected</c:if>>营业</option>
							<option value="停业" <c:if test="${obj.state eq '停业' }">selected</c:if>>停业</option>
							<option value="注销" <c:if test="${obj.state eq '注销' }">selected</c:if>>注销</option>
						</select>
					</div>

				</div>

				<div>
					<table border="0" cellspacing="0" style="width: 100%; margin-left: 10px; margin-top: 10px;">
						<tr style="height: 30px; text-align: center;">
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 3%; text-align: center;">&nbsp;&nbsp;&nbsp;</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 15%; text-align: center;">单位名称</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 11%; text-align: center;">负责人/法人代表</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">乡镇</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 18%; text-align: center;">经营地址</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 11%; text-align: center;">联系电话</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">季度<br />指导数
							</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">年度<br />指导数
							</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">是否有证</td>
							<td style="background-color: #005ea8; color: #fff; font-size: 13px; width: 7%; text-align: center;">状态</td>
						</tr>


						<c:forEach items="${page.list }" var="publicDoc" varStatus="status">
							<tr style="height: 30px; text-align: center; background-color: #fff; color: #1c2b36;" onclick="getSuperviseList(${publicDoc.id })" onmouseover="style.backgroundColor='#eee'" onmouseout="style.backgroundColor='#FFFFFF'">
								<td style="border-bottom: 1px solid #ddd;"><input type="checkbox" name="ids" value="${publicDoc.id }" /></td>
								<td style="border-bottom: 1px solid #ddd;">
									<c:choose>
										<c:when test="${fn:length(publicDoc.companyName) > 8}">
											<c:out value="${fn:substring(publicDoc.companyName, 0, 8)}..." />
										</c:when>
										<c:otherwise>
											<c:out value="${publicDoc.companyName}" />
										</c:otherwise>
									</c:choose>
								</td>
								<td style="border-bottom: 1px solid #ddd;">${publicDoc.legal}</td>
								<td style="border-bottom: 1px solid #ddd;">${publicDoc.street}</td>
								<td style="border-bottom: 1px solid #ddd;">
									<c:choose>
										<c:when test="${fn:length(publicDoc.addressInfo) > 8}">
											<c:out value="${fn:substring(publicDoc.addressInfo, 0, 8)}..." />
										</c:when>
										<c:otherwise>
											<c:out value="${publicDoc.addressInfo}" />
										</c:otherwise>
									</c:choose>
								</td>
								<td style="border-bottom: 1px solid #ddd;">
									<c:choose>
										<c:when test="${fn:length(publicDoc.phone) > 11}">
											<c:out value="${fn:substring(publicDoc.phone, 0, 11)}..." />
										</c:when>
										<c:otherwise>
											<c:out value="${publicDoc.phone}" />
										</c:otherwise>
									</c:choose>
								</td>
								<td style="border-bottom: 1px solid #ddd;">3</td>
								<td style="border-bottom: 1px solid #ddd;">11</td>
								<td style="border-bottom: 1px solid #ddd;">${publicDoc.hasLicense}</td>
								<td style="border-bottom: 1px solid #ddd;"><tags:color value="${publicDoc.state }"></tags:color></td>
							</tr>
						</c:forEach>

					</table>


					<!-- <div style="float: right; margin: 5px; margin-right: 10px;">
						<input type="button" value="上一页" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="1" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="2" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="3" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="4" alt=""
							style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="5" alt="" style="width: 30px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" /> <input type="button" value="下一页" alt="" style="width: 50px; height: 30px; border: none; border-radius: 5px; background-color: #d6585b; color: white; font-size: 13px;" />
					</div> -->
					
					<tags:page></tags:page>
				</div>
			</form>
		<p class="gg_1" id="superviseName">监管记录（单位名称：${superviseDoc.companyName }）</p>
			<div class="record">
				
				<table border="0" cellspacing="0" class="table_2 table_4">
					<thead>
					<tr class="tr_1" style="background-color: #005ea8; color: white;">
						<td>序号</td>
						<td>记录类别</td>
						<td>监督指导时间</td>
						<td style="width: 300px">记录指导</td>
						<td>指导人</td>
						<td>操作</td>
					</tr>
					</thead>
					<tbody id="superviseList">
					<c:forEach items="${superviseList }" var="supervise" varStatus="status">
					<tr class="tr_1">
						<td>${status.count }</td>
						<td>${supervise.type }</td>
						<td><fmt:formatDate value="${supervise.guideDate}" type="date"/></td>
						<td style="width: 300px">${supervise.context }</td>
						<td>${supervise.userName }</td>
						<td><a href="${supervise.id }" id="showbtn" name="showbtn" value="点我弹出层" onclick="showid('smallLay');">详细</a></td>
					</tr>
					</c:forEach>
					</tbody>
				</table>
			</div>
		
		</div>
		

		<!--全部管理对象-->
	</div>
</body>
</html>
